<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>
        <p class="p1">这是一个标签</p>
        <p class="p2">这是一个标签</p>
        <p class="p3">这是一个标签</p>
    </div>
</body>
<script>
    let element = document.createElement('h3')
    element.innerHTML = "创建新节点"
    let div = document.querySelector("div")
    div.appendChild(element)

    let new_node = document.createElement('p')
    new_node.innerHTML = "创建P标签"
   div.insertBefore(new_node,document.querySelector(".p1"))
   div.insertBefore(new_node,document.querySelector(".p2"))
   div.insertBefore(new_node,document.querySelector(".p3"))
</script>
</html>